package com.bush.mall.product.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.product.entity.CommentReplayEntity;
import com.bush.mall.product.service.CommentReplayService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 商品评价回复关系
 * @author RUN
 * @date 2022-11-28
 */
@RestController
@RequestMapping("commentreplay")
@Api(tags = "商品评价回复关系管理" )
public class CommentReplayController {

    @Resource(name= CommentReplayService.BEAN_ID)
    private CommentReplayService commentReplayService;

    /**
     * 分页查询商品评价回复关系列表
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "分页查询商品评价回复关系列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return commentReplayService.queryForPage(current,size);
    }

    /**
     * 保存商品评价回复关系表单
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "保存商品评价回复关系表单")
    @PostMapping("saveCommentReplay")
    public Result saveCommentReplay(@RequestBody CommentReplayEntity commentReplay){
        return commentReplayService.saveCommentReplay(commentReplay);
    }

    /**
     * 修改商品评价回复关系表单
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "修改商品评价回复关系表单")
    @PutMapping("updateCommentReplay")
    public Result updateCommentReplay(@RequestBody CommentReplayEntity commentReplay){
        return commentReplayService.updateCommentReplay(commentReplay);
    }

    /**
     * 通过指定id删除商品评价回复关系
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "通过指定id删除商品评价回复关系")
    @DeleteMapping("deleteCommentReplay")
    public Result deleteCommentReplay(Long id){
        return commentReplayService.deleteCommentReplay(id);
    }

}
